package com.neuedu.javase.var;

/**
 * 类型转换
 */
public class TypeConversion {

    /**
     * main 快捷键
     * @param args
     */
    public static void main(String[] args) {

        byte bnum = 100;
        int intMemmory = bnum;

        //byte--- int  隐式转换
        double salary = 1000;
        int intSalary = (int)salary;

        System.out.println("intSalary = " + intSalary);


        double salary2 = 9999.86;
        // 强制转换  有丢失精度的风险
        int intSalary2 = (int)salary2;
        System.out.println("intSalary2 = " + intSalary2);



        //算数运算
        // 字符

        char lettera = 'A';


        int numOfChara = lettera;

        System.out.println("numOfChara = " + numOfChara);

        System.out.println("(int)'B' = " + (int) 'B');   //'Z'


    }
}
